# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgbase=python-pysha3
pkgname=('python2-pysha3' 'python-pysha3')
_pkgname=pysha3
pkgver=1.0.2
pkgrel=7
pkgdesc='SHA-3 (Keccak) for Python 2.7 - 3.5.'
arch=('x86_64' 'aarch64')
url='https://pypi.org/project/pysha3/#files'
license=('Python')
makedepends=('python2-setuptools' 'python-setuptools')
source=("https://files.pythonhosted.org/packages/source/${_pkgname::1}/$_pkgname/$_pkgname-$pkgver.tar.gz")
sha512sums=('57476d24b9d399471cf56c8c1413f58dbc863c16d4fe9ebd2cf65df8092e139e2505252605e3fccd68978f5ee3fffdfeeedee6788aab38a54c918a452fc19720')

prepare() {
  cp -a "$_pkgname-$pkgver"{,-2}
}

build() {
  cd "$_pkgname-$pkgver-2"

  python2 setup.py build

  cd "$srcdir/$_pkgname-$pkgver"

  python setup.py build
}

package_python2-pysha3() {
  depends=('python2')

  cd "$_pkgname-$pkgver-2"

  python2 setup.py install --root="$pkgdir" --prefix=/usr -O1 --skip-build
}

package_python-pysha3() {
  depends=('python')

  cd "$_pkgname-$pkgver"

  python setup.py install --root="$pkgdir" --prefix=/usr -O1 --skip-build
}

